package com.shuaqiu.sboot.common.bean;

import io.swagger.annotations.ApiModelProperty;

/**
 * 操作结果
 *
 * @param <T> 数据的类型
 */
public class Result<T> {

    /** 操作是否成功 */
    @ApiModelProperty(value = "操作是否成功", required = true)
    private final boolean success;

    /** 相关信息 */
    @ApiModelProperty(value = "相关信息")
    private final String message;

    /** 相关数据 */
    @ApiModelProperty(value = "相关数据")
    private final T data;

    public Result(final boolean success, final String message, final T data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public T getData() {
        return data;
    }
}
